package com.vvv.shortlink.admin.constant;

/**
 * @author vvv
 * @date 2024/1/30 23 26
 * discription redis缓存常量类
 */
public class RedisConstant {

    // ====================================== 业务key ========================================
    /**
     * 注册锁
     */
    public static final String LOCK_REGISTER_USERNAME_KEY = "short-link:lock:register:";

    /**
     * 创建分组锁
     */
    public static final String LOCK_CREATE_GROUP_KEY = "short-link:lock:group:create:";
    
    /**
     * 根据token去redis拿用户信息
     * value: hash
     */
    public static final String LOGIN_USERINFO_KEY = "short-link:login:user_info:";

    /**
     * 防止恶意用户刷token，撑爆redis
     * value: string
     */
    public static final String LOGIN_IS_LOGIN_KEY = "short-link:login:token:";

    // ====================================== TTL 秒为单位 ========================================

    /**
     * 登录状态30天过期
     */
    public static final long LOGIN_TTL = 60 * 60 * 24 * 30;
}
